import { Career } from "./career";
/**
 * 门派
 */
export class Sect {
    private id:number;
    private name:string;
    private career1:Career|null;
    private career2:Career|null;

    constructor(id:number, career1:Career|null, career2:Career|null=null){
        this.id = id;
        this.career1 = career1;
        this.career2 = career2;
        if(career1!=null){
            career1.setSectId(id);
        }
        if(career2!=null){
            career2.setSectId(id);
        }
    }
    public setName(name:string):void{
        this.name = name;
    }
    /**
     * 是否双心法
     * @returns 
     */
    public isDouble():boolean{
        return this.career1!=null&&this.career2!=null;
    }
    public getId():number{
        return this.id;
    }
    public getCareer1():Career|null{
        return this.career1;
    }
    public getCareer2():Career|null{
        return this.career2;
    }
    public getName():string{
        return this.name;
    }
}